import request from '@/utils/request'

export function getConfigList(params) {
    return request({
        url: 'admin/config',
        method: 'get',
        params
    })
}

export function getConfig(key) {
    return request({
        url: `admin/config/${key}`,
        method: 'get',
    })
}

export function addConfig(config) {
    return request({
        url: `admin/config`,
        method: 'post',
        data:config
    })
}

export function updateConfig(config) {
    return request({
        url: `admin/config/${config.configKey}`,
        method: 'put',
        data:config
    })
}

export function deleteConfig(key) {
    return request({
        url: `admin/config/${key}`,
        method: 'delete',
    })
}

export function syncData() {
    return request({
        url: `schedule/api/schedule/sync`,
        method: 'post',
    })
}

export function syncView() {
    return request({
        url: `schedule/api/schedule/viewCount`,
        method: 'post',
    })
}